<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.staticfile.org/react/16.4.0/umd/react.development.js"></script>
    <script src="https://cdn.staticfile.org/react-dom/16.4.0/umd/react-dom.developm ent.js"></script>
    <script src="https://cdn.staticfile.org/babel-standalone/6.26.0/babel.min.js"></script>

</head>
<body>
    <div id="example">

    </div> 
    <script type="text/babel">
     class Hello extends React.Component{ constructor(props){ super(props); this.state = { msg:"change" } }
     render(){ return (
         <div onClick={this.handleClick}>
         {this.state.msg}
         </div>
         ) }handleClick=()=>{ 
             this.setState({ msg:"nihao" 
             }) 
             }
             componentDidMount()
             { console.log(1) } 
             }ReactDOM.render( 
                 <Hello/>, document.getElementById('example') );</script>
</body>
</html>